<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>去签约</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/qianyue.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />		
    <style>
    	.chax_input {
		    display: inline-block;
		    border: 1px solid #DDDDDD;
		    height: 32px;
		    line-height: 32px;
		    padding: 0 10px;
		    margin-left: 10px;
		}
		select{
			 display: inline-block;
		    border: 1px solid #DDDDDD;
		    height: 32px;
		    line-height: 32px;
		    padding: 0 10px;
		}
		.zizh_btn {
		    background: #FF7831;
		    color: white;
		    border: 0;
		    cursor: pointer;
		    width: 120px;
		    border-radius: 2px;
		    font-size: 14px;
		    height: 32px;
		    margin-left: 13px; display: inline-block;
		}
		.city-picker-select{padding: 30px 20px 15px;}
		.city-picker-select select{margin-right: 15px;}
		.index_bottom{display: none;}
		#tip{right: 0; top: 15px; border: 0; padding-left: 20px; font-size: 14px;}
    </style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title"><a href="#">签约管理</a><em></em></span>
					</div>
					<div class="indrig_con qianyue_con">
						<div class="qiany_steps">
							<!--签约步骤-->
							<div class="qiany_steps_item qiany_steps_choice" style="margin-right: -24px; width: 25%;">
								<a href="{:url('index/qianyue_step1',['agent_id'=>$agent_id])}">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">1</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">签约基本信息</div>
									</div>
								</div>
								</a>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<a href="{:url('index/qianyue_step2',['agent_id'=>$agent_id])}">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">2</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">商户注册信息</div>
									</div>
								</div>
								</a>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<a href="{:url('index/qianyue_step3',['agent_id'=>$agent_id])}">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">3</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">结算资金账号</div>
									</div>
								</div>
								</a>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait" style="margin-right: -24px; width: 25%;">
								<a href="{:url('index/qianyue_step4',['agent_id'=>$agent_id])}">
								<div class="qiany_steps_line" style="padding-right: 24px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">4</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">上传附件</div>
									</div>
								</div>
								</a>
							</div>
							<div class="qiany_steps_item qiany_steps-status-wait">
								<a href="{:url('index/qianyue_step5',['agent_id'=>$agent_id])}">
								<div class="qiany_steps_line" style="padding-right: 0px;"><i></i></div>
								<div class="qiany_steps_step">
									<div class="qiany_steps_head">
										<div class="qiany_steps_head_inner"><span class="qiany_steps_icon">5</span></div>
									</div>
									<div class="qiany_steps_main">
										<div class="qiany_steps_title">提交签约</div>
									</div>
								</div>
								</a>
							</div>
						</div>
						<!--签约步骤-->
						 <form class="mui-input-group gerenzl_group layui-form">
							<div class="shxx_item">
								<div class="shxx_title">签约类型与产品</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>商户类型</div>
									<div class="right">
										<input type="radio" name="agent_type" value="1" title="企业" {if $data['agent_type']==1 || $data['agent_type']=="" || $data['agent_type']==null  }checked{/if}>
<!--										<input type="radio" name="agent_type" value="2" title="个人" {if $data['agent_type'] == 2  }checked{/if}>-->
										<input type="radio" name="agent_type" value="3" title="个体工商户" {if $data['agent_type'] == 3  }checked{/if}>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>签约通道</div>
									<div class="right">
										<input type="radio" name="channel" value="1" title="网商银行" checked>
									</div>
								</div>
							</div>
							<div class="shxx_item">
								<div class="shxx_title">经营信息</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>商户全称</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="agent_name1" value="{$data.agent_name1}" class="chax_input" placeholder="商户全称为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">商户全称为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>商户简称</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="agent_name2" value="{$data.agent_name2}" class="chax_input" placeholder="商户简称为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">商户简称为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>行业分类</div>
									<div class="right" style="padding-left: 30px;">
										<select name="trade_type" onchange="select_trade(this);" lay-ignore style="width: 348px;" lay-verify="required">
											{volist name="typelist" id="vo"}
											<option value="{$vo.id}" {if condition="$data.trade_type==$vo.id" } selected="selected" {/if}>{$vo.type_name}</option>
											{/volist}
										</select>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>行业二级分类</div>
									<div class="right" style="padding-left: 30px;">
										<select id="trade_type2" name="trade_type2" lay-ignore style="width: 348px;"  lay-verify="required">
								        	{if $type2}
								        	<option value="{$type2['id']}">{$type2['type_name']}</option>
								        	{else}
								        	<option value="0">选择行业</option>
								        	{/if}
										</select>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>经营地址</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="address" value="{$data.address}" class="chax_input" placeholder="经营地址为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">经营地址为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>客服电话</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="service_tel" value="{$data.service_tel}" class="chax_input" placeholder="客服电话为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">客服电话为必填项</p>
										</div>
									</div>
								</div>
							</div>
							<div class="shxx_item">
								<div class="shxx_title">日常联系人</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>日常联系人</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="contacts" value="{$data.contacts}" class="chax_input" placeholder="日常联系人为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">日常联系人为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>职务</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="job" value="{$data.job}" class="chax_input" placeholder="职务为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">职务为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>联系电话</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text"name="contact_tel" value="{$data.contact_tel}" class="chax_input" placeholder="联系电话为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">联系电话为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>邮箱</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="email" value="{$data.email}" class="chax_input" placeholder="邮箱为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">邮箱为必填项</p>
										</div>
									</div>
								</div>
								<div class="shxx_row clearfix">
									<div class="left"><em>*</em>微信号</div>
									<div class="right">
										<div class="htrig_box">
											<div class="htrig_con">
												<input type="text" name="wechat_no" value="{$data.wechat_no}" class="chax_input" placeholder="微信号为必填项" lay-verify="required" autocomplete="off" class="layui-input">
											</div>
											<p class="redtip">客服电话为必填项</p>
										</div>
									</div>
								</div>
							</div>
							<div class="qiany_bzbtnbox">
								<button type="button" class="qiany_bzbtn" lay-submit lay-filter="submit_from"><span>保存并下一步</span></button>
								<button type="button" class="qiany_bzbtn defult fanhui"><span>返 回</span></button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
<script>
layui.use('form', function() {
	var form = layui.form;
	//监听表单提交
	form.on('submit(submit_from)', function(data){
		tijiao();
  		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
});
//返 回
$('.fanhui').click(function() {
	history.back();
})

	function select_trade(obj){
		var trade_id=$(obj).val();
		var lay = layer.load(0, {shade: false,time: 1.5 * 1000});
		$.ajax({
				type: 'post',
				url: "{:url('index/get_trades')}",
				data: {
					trade_id:trade_id
				},
				success: function(data) {
					var list=data.data;
					if(list){
						var html="<option value='0'>选择行业</option>";
						for(var i=0;i<list.length;i++){
							var trade=list[i];
							html+="<option value="+trade['id']+">"+trade['type_name']+"</option>";
						}
						$("#trade_type2").html(html);

					}
				}
		})
		
	}
	$("#trade_type").val('{$data.trade_type}');
	$("#trade_type2").val('{$data.trade_type2}');

//提交表单
function tijiao(){
	 $.ajax({
         	type:"post",
            url:"{:url('index/qianyue_step1',['agent_id'=>$agent_id])}",
            data: $('.layui-form').serialize(),//表单数据
            success:function(data){
                if(data.code==200){
                	layer.msg('成功', {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						location.href = "{:url('index/qianyue_step2',['agent_id'=>$agent_id])}";
					});
                }else{
                	layer.msg('失败！');//保存成功提示
                }
            },error:function(data){
            	var a = data;
            }
    });
	
}
</script>